home *** CD-ROM | disk | FTP | other *** search
/ NetGuide 2004 April / NETGUID0404N.iso / pc / featured / Windows / VCWVicmans / phedinst.exe / {app} / tdemo.js < prev    next >
Encoding:
Text File  |  2001-09-18  |  1.4 KB  |  49 lines

  1. function isDemoOk()
  2.  
  3. {
  4.  
  5.      IsOk=true;
  6.  
  7.      bver=Math.round(parseFloat(navigator.appVersion) * 1000);
  8.  
  9.      if (navigator.appName.substring(0,8) == "Netscape")
  10.  
  11.      {
  12.  
  13.          if ((bver<5000) && (navigator.appVersion.indexOf("Mac")> 0))
  14.  
  15.              IsOk=false;
  16.  
  17.          else if (bver<4060)
  18.  
  19.              IsOk=false;
  20.  
  21.      }
  22.  
  23.      if (navigator.appName.substring(0,9) == "Microsoft")
  24.  
  25.      {
  26.  
  27.          if(bver<4000)
  28.  
  29.              IsOk=false;
  30.  
  31.      }
  32.  
  33.      plugins=navigator.plugins;
  34.  
  35.      if (plugins!=null && IsOk==false)
  36.  
  37.      {
  38.  
  39.          for(i=0;i!=plugins.length;i++)
  40.  
  41.               if((plugins[i].name.indexOf("1.0")<0) && (plugins[i].name.indexOf("Java Plug-in")>=0))
  42.  
  43.                   IsOk=true;
  44.  
  45.      }
  46.  
  47.      return IsOk;
  48.  
  49. }
  50.  
  51.  
  52.  
  53. function openDemo(htmlFile,htmlWidth,htmlHeight)
  54.  
  55. {
  56.  
  57. var bua = navigator.userAgent;
  58.  
  59.  
  60.  
  61.      s = 'resizable=0,toolbar=0,menubar=0,scrollbars=0,status=0,location=0,directory=0,width=350,height=200';
  62.  
  63.      if(!isDemoOk())
  64.  
  65.      {
  66.  
  67.           open("http://www.turbodemo.com/error.html",'',s);
  68.  
  69.      }
  70.  
  71.      else
  72.  
  73.      {
  74.  
  75.  
  76.  
  77.      if (bua.indexOf("Opera")!= -1) 
  78.  
  79.       {
  80.  
  81.           window.open(htmlFile+".htm",'','width='+htmlWidth+',height='+htmlHeight+',top=10,left=10');
  82.  
  83.       }
  84.  
  85.      else
  86.  
  87.       {
  88.  
  89.           window.open(htmlFile+".htm",'','width='+htmlWidth+',height='+htmlHeight+',top=10,left=10');
  90.  
  91.       }
  92.  
  93.  
  94.  
  95.      }
  96.  
  97. }